package com.tm.purchase.service.impl;

import com.tm.purchase.Mapper.ProductMapper;
import com.tm.purchase.domain.Product;
import com.tm.purchase.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * @Date 2025-3-5
 * @Author: Cjj
 */
@Service
public class ProductServiceImpl implements ProductService {

    @Autowired
    private ProductMapper productMapper;

    @Override
    public List<Product> getAllProducts(Product product ) {
        List<Product> list=productMapper.getAllProducts(product);
        return list;
    }

    @Override
    public List<Product> getProductById(Long id) {
        List<Product> list=productMapper.getProductById(id);
        return list;
    }

    @Override
    public List<Product> saveProduct(Product product) {
        return  productMapper.saveProduct(product);
    }

    @Override
    public List<Product> editProduct(Long id, Product product) {
        return productMapper.editProduct(id,product);
    }

    @Override
    public String deleteProduct(Long id) {

        return  productMapper.deleteProduct(id);
    }
}
